package com.xh.common.thread.ext.limit;

import java.util.List;
import java.util.concurrent.AbstractExecutorService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;

public class AdapterExecutorService extends AbstractExecutorService {

    protected ExecutorService mService;

    public AdapterExecutorService(ExecutorService service) {
        mService = service;
    }

    @Override
    public void shutdown() {
        mService.shutdown();
    }

    @Override
    public List<Runnable> shutdownNow() {
        return mService.shutdownNow();
    }

    @Override
    public boolean isShutdown() {
        return mService.isShutdown();
    }

    @Override
    public boolean isTerminated() {
        return mService.isTerminated();
    }

    @Override
    public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
        return mService.awaitTermination(timeout, unit);
    }

    @Override
    public void execute(Runnable command) {
        mService.execute(command);
    }
}
